package admin.controllers;

import helpers.PaginatorHelper;

import java.io.IOException;
import java.net.URLDecoder;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entities.ApplicationTemplate;

import admin.models.ApplicationTemplateModel;

public class ApplicationTemplateListServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException {
		
		ApplicationTemplateModel appTemplateModel = ApplicationTemplateModel.getInstance();
		List<ApplicationTemplate> templates = appTemplateModel.listAll();
		
		request.setAttribute("templates", templates);
		
		try {
			request.getRequestDispatcher("/admin/pages/application_template_list.jsp").forward(request, response);
		} catch (ServletException e) {
			e.printStackTrace();
		}
	}
}
